<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>途爱网机票分销平台后台管理 - Powered By Tourair.cn</title>
<%@ include file="/common/taglibs.jsp"%>
<meta name="author" content="tj" />
<meta name="copyright" content="tourair" />
<link href="${ctx}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/resources/admin/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/jsbn.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/prng4.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/rng.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/rsa.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/base64.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/common.js"></script>
<script type="text/javascript">
	$().ready( function() {
		
		var $loginForm = $("#loginForm");
		var $enPassword = $("#enPassword");
		var $username = $("#username");
		var $password = $("#password");
		var $captcha = $("#captcha");
		var $captchaImage = $("#captchaImage");
		var $isRememberUsername = $("#isRememberUsername");
		
		// 记住用户名
		if(getCookie("adminUsername") != null) {
			$isRememberUsername.prop("checked", true);
			$username.val(getCookie("adminUsername"));
			$password.focus();
		} else {
			$isRememberUsername.prop("checked", false);
			$username.focus();
		}
		
		// 更换验证码
		$captchaImage.click( function() {
			$captchaImage.attr("src", "${ctx}/kaptcha.jpg&timestamp=" + (new Date()).valueOf());
		});
		
		// 表单验证、记住用户名
		$loginForm.submit( function() {
			if ($username.val() == "") {
				$.message("warn", "请输入您的用户名");
				return false;
			}
			if ($password.val() == "") {
				$.message("warn", "请输入您的密码");
				return false;
			}
			if ($captcha.val() == "") {
				$.message("warn", "请输入您的验证码");
				return false;
			}
			if ($isRememberUsername.prop("checked")) {
				addCookie("adminUsername", $username.val(), {expires: 7 * 24 * 60 * 60});
			} else {
				removeCookie("adminUsername");
			}
		});
	});
	
	if (self != top) {
		top.location = self.location;
	};
</script>
</head>
<body>
		<div class="login">
			<form id="loginForm" autocomplete="off" action="${ctx }/admin_Admin_main.action" method="post">
				<input type="hidden" id="enPassword" name="enPassword" />
				<input type="hidden" name="captchaId" value="b3e06608-b8fa-4f12-a79e-1b159f2d984e" />
				<table>
					<tr>
						<td width="190" rowspan="2" align="center" valign="bottom">
							<img src="${ctx }/resources/admin/images/header_logo.gif" title="途爱国际机票分销平台" />
						</td>
						<th>用户名:</th>
						<td>
							<input type="text" id="username" name="username" class="text"　value="admin" maxlength="20" />
						</td>
					</tr>
					<tr>
						<th>密&nbsp;&nbsp;&nbsp;码:</th>
						<td>
							<input type="password" id="password" class="text" value="admin" maxlength="20" autocomplete="off" />
						</td>
					</tr>

					<tr>
						<td>&nbsp;</td>
						<th>验证码:</th>
						<td>
							<input type="text" id="captcha" name="captcha" class="text captcha" maxlength="4" autocomplete="off" />
							<img id="captchaImage" class="captchaImage" src="${ctx }/kaptcha.jpg" title="点击更换验证码" />
						</td>
					</tr>

					<tr>
						<td>
							&nbsp;
						</td>
						<th>
							&nbsp;
						</th>
						<td>
							<label>
								<input type="checkbox" id="isRememberUsername" value="true" />
								记住用户名
							</label>
						</td>
					</tr>
					<tr>
						<td>
							&nbsp;
						</td>
						<th>
							&nbsp;
						</th>
						<td>
							<input type="button" class="homeButton" value="" onclick="location.href='/'" /><input type="submit" class="loginButton" value="登录" />
						</td>
					</tr>
				</table>
				<div class="powered">
					COPYRIGHT © 2012-2013 TOURAIR.CN ALL RIGHTS RESERVED.
				</div>
			</form>
		</div>
	</body>
</html>